package com.hema.auction.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;

/**
 * 描述:
 * 作者:john
 */
public class OrderInfo implements Parcelable {

    /**
     * order_id : 2877
     * type : 2
     * good_id : 7041
     * status : 0
     * auction_time : 1502955553
     * good_pic : http://app.sdjpai.cn//uploads/defaults/699245405958.png
     * price : 2199
     * gw_price : 0
     * is_gw_price_lock : 1
     * consignee : 刘德华
     * c_phone : 18680371111
     * address : 北京市 北京市 朝阳区百度科技大厦
     */

    @SerializedName("order_id")
    private String orderId;
    @SerializedName("type")
    private int type;
    @SerializedName("good_id")
    private String goodId;
    @SerializedName("status")
    private int status;
    @SerializedName("auction_time")
    private int auctionTime;
    @SerializedName("good_pic")
    private String goodPic;
    @SerializedName("price")
    private float price;
    @SerializedName("gw_price")
    private float gwPrice;
    @SerializedName("final_price")
    private float finalPrice;
    @SerializedName("is_gw_price_lock")
    private int isGwPriceLock = 1;
    @SerializedName("consignee")
    private String consignee;
    @SerializedName("c_phone")
    private String cPhone;
    @SerializedName("address")
    private String address;

    public static OrderInfo objectFromData(String str) {

        return new Gson().fromJson(str, OrderInfo.class);
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getGoodId() {
        return goodId;
    }

    public void setGoodId(String goodId) {
        this.goodId = goodId;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public int getAuctionTime() {
        return auctionTime;
    }

    public void setAuctionTime(int auctionTime) {
        this.auctionTime = auctionTime;
    }

    public String getGoodPic() {
        return goodPic;
    }

    public void setGoodPic(String goodPic) {
        this.goodPic = goodPic;
    }

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
    }

    public float getGwPrice() {
        return gwPrice;
    }

    public void setGwPrice(float gwPrice) {
        this.gwPrice = gwPrice;
    }

    public int getIsGwPriceLock() {
        return isGwPriceLock;
    }

    public void setIsGwPriceLock(int isGwPriceLock) {
        this.isGwPriceLock = isGwPriceLock;
    }

    public String getConsignee() {
        return consignee;
    }

    public void setConsignee(String consignee) {
        this.consignee = consignee;
    }

    public String getCPhone() {
        return cPhone;
    }

    public void setCPhone(String cPhone) {
        this.cPhone = cPhone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public float getFinalPrice() {
        return finalPrice;
    }

    public void setFinalPrice(float finalPrice) {
        this.finalPrice = finalPrice;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.orderId);
        dest.writeInt(this.type);
        dest.writeString(this.goodId);
        dest.writeInt(this.status);
        dest.writeInt(this.auctionTime);
        dest.writeString(this.goodPic);
        dest.writeFloat(this.price);
        dest.writeFloat(this.gwPrice);
        dest.writeFloat(this.finalPrice);
        dest.writeInt(this.isGwPriceLock);
        dest.writeString(this.consignee);
        dest.writeString(this.cPhone);
        dest.writeString(this.address);
    }

    public OrderInfo() {
    }

    protected OrderInfo(Parcel in) {
        this.orderId = in.readString();
        this.type = in.readInt();
        this.goodId = in.readString();
        this.status = in.readInt();
        this.auctionTime = in.readInt();
        this.goodPic = in.readString();
        this.price = in.readFloat();
        this.gwPrice = in.readFloat();
        this.finalPrice = in.readFloat();
        this.isGwPriceLock = in.readInt();
        this.consignee = in.readString();
        this.cPhone = in.readString();
        this.address = in.readString();
    }

    public static final Parcelable.Creator<OrderInfo> CREATOR = new Parcelable.Creator<OrderInfo>() {
        @Override
        public OrderInfo createFromParcel(Parcel source) {
            return new OrderInfo(source);
        }

        @Override
        public OrderInfo[] newArray(int size) {
            return new OrderInfo[size];
        }
    };
}
